﻿using CloudMusic.Helper;
using CloudMusic.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace CloudMusic.ViewModel
{
    public class UCUserInfoViewModel : MusicViewModelBase
    {
        private string imgUrl = @"pack://application:,,,/Image/demo.jpg";
        public string ImgUrl
        {
            get { return imgUrl; }
            set { imgUrl = value; OnPropertyChanged("ImgUrl"); }
        }
        private string name;
        public string Name
        {
            get { return name; }
            set { name = value; OnPropertyChanged("Name"); }
        }
        private string dt;
        public string Dt
        {
            get { return dt; }
            set { dt = value; OnPropertyChanged("Dt"); }
        }
        private string gz;
        public string Gz
        {
            get { return gz; }
            set { gz = value; OnPropertyChanged("Gz"); }
        }
        private string fs;
        public string Fs
        {
            get { return fs; }
            set { fs = value; OnPropertyChanged("Fs"); }
        }
        private Visibility type = Visibility.Hidden;
        public Visibility Type
        {
            get { return type; }
            set { type = value; OnPropertyChanged("Type"); }
        }
        public UCUserInfoViewModel(userInfo ul)
        {
            if (PlayListHelper.UserInfos.Count > 0)
            {
                ImgUrl = ul.AvatarUrl;
                Name = ul.Nickname;
                Dt = ul.EventCount.ToString();
                Gz = ul.Follows.ToString();
                Fs = ul.Followeds.ToString();
                if (ul.VipType == 11)
                {
                    Type = Visibility.Visible;
                }
            }
        }
    }
}
